const sequelize = require('./db');
const { DataTypes } = require('sequelize');
const Student = require('./Student');

// 定义Class模型
const Class = sequelize.define('Class', {
    name: {
        type: DataTypes.STRING,
        allowNull: false
    },
    openDate: {
        type: DataTypes.DATE,
        allowNull: false
    }
}, {
    tableName: 'classes',
    createdAt: false,
    updatedAt: false,
    paranoid: true
});

Class.hasMany(Student);

module.exports = Class;